File operations Using Sharepoint connector in Mule 4
In this tutorial we will demonstrate how can we perform file operations using sharepoint connector in mule 4
Microsoft SharePoint Connector supports both SharePoint 2013 and SharePoint Online for the use in the cloud and on-premises. This connector used to manage content and document management, you can perform multiple operation with sharepoint like fileupload,create folder,file read, file checkin etc.
Prerequisite:
- Should have access to Microsoft sharepoint
- Sharepoint connector should be available in palette(Kindly add the sharepoint if not present in mule palette)
File Upload
Here we will read the file from a local directory and upload the CSV file to sharepoint using File add operation of sharepoint connector
Create a project in anypoint studio and configure the listener to trigger the request
Configure the sharepoint connection(Please visit last tutorial see the steps to register on sharepoint and get the credentials)
Configure the server relative url and File Content as payload as data which is to upload on sharepoint
Create the message to send back to client
Deploy the project and trigger from SOAPUI
We can see file uploaded successfully to sharepoint
File Get Content
Here we will read the CSV file data using file get content operation of mule sharepoint connector
Drag and drop the File get content operation from mule palette
Configure the connection details
Provide the server relative url
Deploy the project and trigger the request from soapui
Logger data printed
Sample Project: sharepoint connector
Great Article and very useful. I was able to follow your steps and configure my connection to sharepoint online. However, I’m getting a “Unable to obtain access token”. Any ideas as to what might be causing this? I changed password to an incorrect one and it returns “invalid credentials”. So, I know it’s not the credentials.
Hi, thank you for all these useful demos. I was wondering if you have tried the sharepoint connector for child sites? That is e.g. mulesy.sharepoint.com/myTeam/Shared Documents/Records/Sample.csv
please post an example of on modified objects
Hello Mulesy,
I am trying to “file get content” from sharepoint by following above steps. But, I am getting below error.
ERROR:
org.mule.runtime.core.api.expression.ExpressionRuntimeException: “Script ‘ ‘ has errors:
Missing Body Expression. i.e dw 2.0
—
true at 1 : 1″ evaluating expression: ”
Please advise.
I am using File add connector, I am trying to do test connection once entered username and password but test connection got successful once and if I try again doing test connection getting invalid credentials error. I am not able to figure out the what is the issue. But credentials are working when I login from browser. facing issue in studio.
Please advise